{% load i18n %}

<ul class="pagination justify-content-center">
    {% if page.has_previous %}
        <li class="page-item">
            <a href="?page={{ page.previous_page_number }}" class="page-link">
                « {% translate "previous" %}
            </a>
        </li>
    {% else %}
        <li class="page-item disabled">
            <a href="#" class="page-link">« {% translate "previous" %}</a>
        </li>
    {% endif %}

    {% for i in page_range %}
        {% if page.number != i %}
            <li class="page-item">
                <a href="?page={{ i }}" class="page-link">
                    {{ i }}
                </a>
            </li>
        {% else %}
            <li class="page-item active">
                <a href="#" class="page-link">{{ i }}</a>
            </li>
        {% endif %}
    {% endfor %}

    {% if page.has_next %}
        <li class="page-item">
            <a href="?page={{ page.next_page_number }}" class="page-link">
                {% trans "next" %} »
            </a>
        </li>
    {% else %}
        <li class="page-item disabled">
            <a href="#" class="page-link">{% trans "next" %} »</a>
        </li>
    {% endif %}
</ul>

